package Person;

import Operation.*;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yinsh
 * Date: 2025-01-13
 * Time: 14:06
 */
public class Normal {
    private String name;

    public Normal(String name) {
        this.name = name;
    }

    public void menu() {
        while (true) {
            System.out.println("*****欢迎阅览 " + name + "**************");
            System.out.println("请选择你的操作：");
            System.out.println("0.退出");
            System.out.println("1.添加图书");
            System.out.println("2.删除图书");
            System.out.println("3.查找图书");
            System.out.println("4.显示图书");
            Scanner scan = new Scanner(System.in);
            int choice = scan.nextInt();
            Operation[] operation = new Operation[]{
                    new ExitOperation(),
                    new AddOperation(),
                    new DeleteOperation(),
                    new FindOperation(),
                    new ShowOperation()
            };
            operation[choice].work();
        }
    }
}
